home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-03-10 | 5.5 KB | 180 lines | [TEXT/MPS ] |
-
- PCCTS 1.22 Release Notes
-
- Active Author for 1.22 Release:
-
- Terence Parr
- Parr Research Corporation
- 5517 Pleasant Ave
- Minneapolis, MN 55419
- parrt@acm.org
-
- Other authors:
-
- Russell Quong, quong@ecn.purdue.edu
- Will Cohen, cohenw@ecn.purdue.edu
- Hank Dietz, hankd@ecn.purdue.edu
-
- August 24, 1994
-
-
- This document describes the 1.22 release of the Purdue Compiler
- Construction Tool Set (PCCTS). This file describes the changes
- made to PCCTS 1.21 to arrive at PCCTS 1.22. A number of bug fixes
- were made and the C++ output was cleaned up. The original 1.00
- manual and all release notes are required for a complete
- documentation set for PCCTS. A book is in the works and the
- papers provided at the ftp site don't hurt.
-
- PCCTS is in the public-domain and can be obtained at
- everest.ee.umn.edu in pub/pccts/1.22. The newsgroup
- comp.compilers.tools.pccts provides a discussion forum. To
- receive future release broadcast messages, register yourself by
- sending email to pccts@ecn.purdue.edu with a ``Subject:'' line of
- ``register''.
-
- The authors make no claims that this software will do what you
- want, that this manual is any good, or that the software actually
- works---use PCCTS at your own risk. Bug reports and/or cheery
- reports of its usefulness are very welcome, however.
-
- The maintenance and support of all PCCTS tools is primarily
- provided by Parr Research Corporation, Minneapolis MN. Please see
- file PCCTS.FUTURE for more information. All PCCTS tools currently
- in the public domain will continue to be in the public domain.
-
-
- I. NEW FEATURES
-
- o In C++ mode, the normal parser initialization sequence is:
-
- main()
- {
- DLGFileInput in(stdin);
- DLGLexer scan(&in,2000);
- ANTLRTokenBuffer pipe(&scan, k);
- ANTLRToken aToken;
- scan.setToken(&aToken);
- Expr parser(&pipe);
- parser.init();
- parser.e();
- }
-
- As described below in ``C++ CLEANUP'', the new sequence can
- be shortened somewhat to:
-
- main()
- {
- DLGFileInput in(stdin);
- DLGLexer scan(&in);
- ANTLRTokenBuffer pipe(&scan);
- ANTLRToken aToken;
- scan.setToken(&aToken);
- Expr parser(&pipe);
- parser.init();
- parser.e();
- }
-
- where the scanner text buffer size is now 2000 bytes by
- default. The 'k' value of your parser (determined by the
- ANTLR command line) is set automatically by the parser
- constructor (it sends a message to the token buffer).
-
- This code fragment is pretty common and we now provide
- a template to allow the following:
-
- ... // other normal includes
- #include "PBlackBox.h" // Standard Black Box for parsing.
- main()
- {
- ParserBlackBox<DLGLexer, Expr, ANTLRToken> parser(stdin);
- parser.parser()->prog();
- }
-
- where parser.parser() returns the instance of 'Expr' created
- by the ParserBlackBox.
-
- This is only experimental. Feel free to provide feedback or
- suggest a better ``black box'' (e.g., can we do without
- templates).
-
-
- II. C++ CLEANUP
-
- o You no longer have to specify the text buffer size for the lexer
- constructor.
-
- o You no longer have to specify the 'k' value for the ANTLRTokenBuffer.
- This is set automatically by the parser to which the token buffer
- is attached.
-
- o Added an ``#ifndef DLGLEXER_H'' gate on the DLGLexer.h file output
- from DLG. It is also sensitive to the file name; i.e., ``#ifndef
- MYLEXER_H''.
-
- o Function LT(i) now returns an ANTLRTokenBase not an ANTLRLightweightToken
- because it is most token objects will be of a type derived from
- ANTLRTokenBase. This allows LT(i)->getText() to be specified without
- a type cast on the LTi).
-
- o DLG defined a bunch of constants such as MAX_MODE and all the lexical
- classes that you specified in your grammar. In 1.21, they were
- #defines. Now they are const's in the lexer class definition. As a
- result, multiple lexers with the identical lexical classes can be
- linked together without collision. ZZSHIFT() became an inline function
- from a macro as well. To access the constants from outside the
- lexer member functions, you must use the class override; e.g.,
- ``scanner.mode(MyLexer::START)''.
-
-
- III. THINGS TO REMEMBER
-
- o Whenever you use k>1 or when you backtrack in C++ mode, you must
- use ANTLRBacktrackingToken or something similar--that is, makeToken()
- must return a stream of unique token objects. See the 1.21 release
- notes.
-
-
- IV. BUGS
-
- o The syntactic predicates at k==1 where broken in 1.20 (I think) so
- that they did not save the lexical text buffer. This has been
- fixed.
-
- o In testcpp/9/test.g, there should have been a 'public' on the
- inheritance from ASTBase.
-
- o zzline was updated incorrectly in C mode.
-
- o A small bug was found in genmk that resulted in
- outdir/outdir/err.o rather than outdir/err.o.
-
- o zzreal_line was not defined in K&R C mode.
-
- o The following grammar was not analyzed correctly (if you
- can believe it <wink>):
-
- a : A a | ;
-
- o The C++ AST code generation didn't generate the right code
- for
-
- a! : b <<#0=#1;>> ;
-
- o The following didn't result in a correct parser:
-
- a : (A B|B C) | b ;
- b : <<predicate>>? B B;
-
- o When using #tokdefs, redefinition errors were reported in the
- grammar file not the token definition file.
-
-
- V. ACKNOWLEDGEMENTS
-
- Kurt Fickie at the Army Research Lab suggested the ParserBlackBox class.
-
- Thanks to all you folks to tested 1.22 before its release.
-
- Thanks as always to the cool folks at NeXT, Inc.
-